home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
amigalib.mk
next >
Wrap
Makefile
|
1994-10-19
|
4KB
|
130 lines
# Amiga Library Services - CD Administration Makefile
#
# This Makefile goes in the root directory of the CD-ROM master file
# tree and is responsible for doing such things as:
#
# (1) Building the automatically generated files for the release.
# (2) "Cleaning up" the file tree.
#
# It is typically used from the root directory as:
#
# make -f AMIGALIB.MK [targets to make]
CDNAME = LR_V1.0
PUBLISHER = "Amiga Library Services - (602) 917-0917"
PREPARER = "Fred Fish"
IMAGE = ISO:$(CDNAME).iso
# The default thing to do is to just emit a message asking the user
# to make a particular target.
all:
@echo "rerun make with one of:"
@echo " [iso, rebuild]"
# This target will rebuild all the machine generated files, after doing
# a "make clobber".
rebuild: DIRLIST FILELIST CRCLIST
# Build the ISO-9660 image using mkisofs. Below are some typical flags
# that might be used, and their meanings.
#
# -a Include all files
# -A Map filenames to ISO compliant file names.
# -c Do not convert filenames
# -e Sort file extents by common extensions.
# -r Inhibit relocation of directories.
# -R Enable RockRidge extensions.
# -T Generate a file TRANS.TBL to make ISO names to original names.
iso: CRCLIST
mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
-V $(CDNAME) $(CDNAME):
# Build the DIRLIST, FILELIST and CRCLIST files. Note that we ensure
# that a FILELIST and CRCLIST file exist by touching them before building
# the updated FILELIST, and then removing the CRCLIST file (even a
# previously existing one) after building the new FILELIST, since the
# CRCLIST needs to be rebuilt anyway if the FILELIST is touched. However
# since we can't compute a CRC for the CRC file itself without major
# trickery, the CRCLIST is generated using a copy of FILELIST that has
# had the CRCLIST line removed. All these gyrations ensure that the
# FILELIST file includes entries for both itself and the CRCLIST file,
# while the CRCLIST file contains no entry for itself.
#
# Also note that the output is stored in a temporary file on a different
# volume, so as to avoid problems on the Amiga with "find" trying to
# lock CRCLIST while it is open for write.
DIRLIST:
find . -type d -print | sort | sed -e "s:^./::" -e "/^\.$$/d" >/tmp/DIRLIST
cp /tmp/DIRLIST $@
rm -f /tmp/DIRLIST
FILELIST: DIRLIST
touch $@ CRCLIST
find . -type f -print | sort | sed "s:^./::" >/tmp/FILELIST
cp /tmp/FILELIST $@
rm -f /tmp/FILELIST CRCLIST
CRCLIST: FILELIST
sed "/^CRCLIST$$/d" <FILELIST >/tmp/FILELIST
brik -Gvbf /tmp/FILELIST >$@
# Clean out the machine generated files in preparation for rebuilding them.
clobber: clean
rm -f DIRLIST FILELIST CRCLIST
clean:
rm -f *! *~
# Update all hardwired device names in LoadObject commands prior to releasing
# a new version of this CD for which the volume name changes. Note that we
# restrict ourselves to LoadObject commands that start a line, which helps us
# to avoid changing *this* file as well!
fix: FILELIST
cat FILELIST | xargs grep -li "^[ \t]*LoadObject[ \t]*.*:" >/tmp/LoadObject.list
for i in `cat /tmp/LoadObject.list`; do \
echo -n "Checking $$i ... "; \
sed "s@LoadObject[ \t]*.*:@LoadObject $(CDNAME):@" <$$i >/tmp/tmpfile; \
if cmp $$i /tmp/tmpfile >/dev/null; then \
echo "not changed."; \
else \
cp /tmp/tmpfile $$i; \
echo "fixed."; \
fi; \
done
cat /tmp/LoadObject.list | xargs grep -i LoadObject | grep -v $(CDNAME)
rm -f /tmp/LoadObject.list
# Examine the FILELIST and gripe about any names that are not strictly
# MS-DOS conformant (8.3, uppercase alphanumeric, etc).
dosnames: FILELIST
-doschk <FILELIST
-grep "[^A-Z_0-9./]" <FILELIST >/tmp/badchars
-if test -s /tmp/badchars ; then \
echo; \
echo "WARNING - The following pathnames contain illegal MS-DOS characters:"; \
cat /tmp/badchars; \
fi
rm -f /tmp/badchars
-grep "[A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9]" <FILELIST >/tmp/TooLong
-if test -s /tmp/TooLong ; then \
echo; \
echo "WARNING - The following pathnames contain prefixes or suffixes over 8 characters long:"; \
cat /tmp/TooLong; \
fi
rm -f /tmp/TooLong